<template>
	<view class="content">
		<!-- 头部图片展示页面 -->
		<view class="mianImageBox" v-if="groupDetails !='' ">
			<view class="casual">
				<view class="swiper-box">
					<image :src="qiniu+groupDetails.main_img+'?imageView2/0/w/800'" class="image" style="width: 100%;"></image>
				</view>
			</view>
			<!-- 价格栏 -->
			<view class="price">
				
				<text v-if="groupDetails.property == 0">￥{{groupDetails.pay_price/100}}</text>
				<text v-if="groupDetails.property == 1">{{groupDetails.pay_price/100}}积分</text>
				<!-- <text v-if="goodsInfos.money_min!=goodsInfos.money_max">￥{{goodsInfos.money_min/100}}~{{goodsInfos.money_max/100}}</text>
				<text v-else>￥{{goodsInfos.money_min/100}}</text> -->
			</view>

			<view class="goodsInfor">
				<view class="goodsdes">
					<view class="goods-name">
						<!-- <text class="self">自营</text> -->
						<text clas="all-name">{{groupDetails.shop_goods_name}}</text>
						<!-- <text class="details-des">22222</text> -->
					</view>
				</view>
				<view class="deliverInfor">
					<view class="to">
						<text class="first">配送</text>
						<text class="to">至</text>
						<text>{{groupDetails.country}}{{groupDetails.province}}{{groupDetails.city}}{{groupDetails.district}}{{groupDetails.details}}</text>
					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import eonfox from "@/components/eonfox/eonfox.js"
	import fns from '@/components/eonfox/fns.js'
	var ef = new eonfox();
	export default {
		data(){ 
			return {
				order_id:'',
				groupDetails:{},
				qiniu:''	
			}
		},
		onLoad:function(e){
					var that = this;
					if(e.order_id){
						that.order_id=e.order_id;
						console.log('打印拼团',that.order_id);
					}
					ef.submit({
						request: {
							config: ['APPLICATIONCONFIG'],//获取七牛云地址
							groupDetails: ['SHOPGROUPGOODSSELFGETORDER',[{group_order_id:that.order_id}]]
						},
						callback: function(data) {
							var res = fns.checkError(data, ['config','groupDetails'], function(errno, error) {
								fns.err(error)
						});
						if (!res) {
							return false;
						}
						console.log("回调成功", res);
								
						// 获取七牛云地址
						if (res.config && res.config.qiniu_domain) {
							that.qiniu = res.config.qiniu_domain
						}
						if(res.groupDetails){
							console.log("1111111111",res.groupDetails)
							that.groupDetails = res.groupDetails;
						}
								
							},
						error: function(err) {
							uni.showToast({
								title: '出错啦',
								icon: 'none'
						});
					}
				})
		}
	}
</script>
<style scoped lang="stylus" ref="stylesheet/stylus">
	.content 
	 width 100%	
	 height 100%
	.mianImageBox
		width 100%
		height 100%
		background-color #fff
		display flex
		align-items center       // 垂直居中
		flex-direction column
		position relative
		.operateBox
			width 95%
			height 10%
			.titleIcon
				width 49%
			.right
				text-align right
				margin-right 5upx
		.casual
			width 100%
			height 100%
			.swiper-box
				width 100%
				height 100%
				// margin-left 8%
				// padding-top 40upx
				.swiper
				   width 100%
					height 100%
					display flex
					justify-content center
					align-items center
					.image
						 width 100%
						 height auto
		.price
			width 100%
			height 20px
			margin 10px 0
			background-color #fff
			text:nth-child(1)
				font-size 44upx
				color red
				font-weight 600
				margin-right 24upx
			text:nth-child(2)
				font-size 24upx
				color #7c7c7c
			text:nth-child(3)
				display inline-block
				padding 5upx 15upx
				font-size 24upx
				color #fff
				background-color #e44545
				margin-left 15upx
		.goodsInfor
			width 95%
			// height 1000upx
			display flex
			justify-content center
			align-items center
			flex-wrap wrap
			.discountCard
				padding-left 20upx
				width 100%
				height 60upx
				background-color #f4f3f3
				text:nth-child(1)
					font-size 22upx
					color #fff
					background-color #333
					padding 5upx 10upx
				text:nth-child(2)
					font-size 22upx
					color #fff
					background-color #666
					padding 5upx 10upx
				text:nth-child(3)
					font-size 24upx
					color #333
					letter-spacing 3upx
					margin-left 20upx
					margin-right 240upx
				text:nth-child(4)
					display inline-block
					font-size 24upx
					line-height 60upx
					text-align center
					width 80upx
					height 60upx
					padding 0 12upx
					background-color #ccc
			.goodsdes
				width 100%
				height 150upx
				padding-top 30upx
				.choose-kinds
					width 100%
					height 68upx
					font-size 24upx
					text
						padding 10upx 20upx
						border-radius 20upx
						background-color #fff
					text:nth-child(1)
						border 1px solid #ccc
					.ex
						color #e44545
						margin-left 20upx
						border 1px solid #e44545
				.goods-name
					width 100%
					height 110upx
					font-size 32upx
					background-color #fff
					line-height 45upx
					.self
						color #e44545
						font-size 24upx
						padding 3upx 12upx
						border 1px solid #e44545
						margin-right 20upx
					.details-des
						display block
						margin 10upx 0
						font-size 24upx
						color #7c7c7c
						letter-spacing 2upx
				.other-des
					width 100%
					height 80upx
					font-size 24upx
					color #333
					background-color #f4f3f3
					display flex
					justify-content left
					align-items center
					.origin, .method
						width 30%
						image
							width 40upx
							height 30upx
							margin -2upx 20upx
						.img
							background-color #fff
						text
							display inline-block
							line-height 80upx
							
			.deliverInfor
				width 100%
				height 130upx
				font-weight 600
				.to
					width 100%
					height 110upx
					line-height 110upx
					font-size 28upx
					border-top 1px solid #f4f3f3
					border-bottom 1px solid #f4f3f3
					position relative
					.first
						margin 0 22upx
					.to
						border none
						margin-right 15upx
					.icon
						font-size 32upx
						position absolute
						top 3upx
						right -2upx
				.freight
					width 100%
					height 110upx
					line-height 110upx
					font-size 28upx
					background-color #fff
					position relative
					.first
						margin 0 22upx
					.icon
						font-size 32upx
						position absolute
						top 3upx
						right -2upx
				.intro
					width 100%
					height 110upx
					line-height 110upx
					font-size 28upx
					border-top 1px solid #f4f3f3
					position relative
					.first
						margin 0 18upx
					.des
						display inline-block
						font-size 24upx
						font-weight 400
						height 60upx
						color #ccc
					.icon
						font-size 32upx
						position absolute
						top 3upx
						right -2upx
	
</style>
